const http = require("http");
const fs = require("fs");

http.createServer((req, res) => {
    let userId = parseInt(Math.random() * 1000) + 1000;
    console.log(`${userId}开始`)
    res.writeHead(200, { "Content-type": "text/html;charset=UTF8" })
    fs.readFile("./async.txt", (err, data) => {
        console.log(`${userId}结束访问页面`)
        res.end(data);
    })
}).listen(3000)